<template>
	<div class="app-container">
		<div slot="header" style="font-size: 20px;">
			<span>会议签到</span>
		</div>
		<el-card >
			<el-form ref="staff" :model="staff" label-width="70px">
				<el-form-item label="职工编号">
					<el-input v-model="staff.staffNum"></el-input>
				</el-form-item>
				<el-form-item label="职工电话">
					<el-input v-model="staff.staffPhone"></el-input>
				</el-form-item>
				<el-form-item label="职工姓名">
					<el-input v-model="staff.staffName"></el-input>
				</el-form-item>
				<span>
					<el-button style="display:block;margin:0 auto" type="primary" @click="handleSign()">确认签到</el-button>
				</span>
			</el-form>
		</el-card>
	</div>
</template>

<script>
import qs from 'qs';
	export default {
		data() {
			return {
				staff: {
					staffNum: '',
					staffName: '',
					staffPhone:''
				},
			}
		},
		created() {

		},
		methods: {
			async handleSign(){
			const uuid = require('uuid')
			console.log(uuid.v1())
			//let id = this.$route.query.id
			const { data: res } = await this.$http.post('/sign',qs.stringify({staffNum:this.staff.staffNum,
			staffName:this.staff.staffName,staffPhone: this.staff.staffPhone,
			meetingId:this.$route.query.id,uuid:uuid.v1()}))
            if (res.code !== 100) {
                return this.$message.error(res.message)
            }else{
                return this.$message.success('签到成功！')
                
            }
		}
		}

	}
</script>

<style lang="scss" scoped>
	.app-container {
	    position: absolute;
	    left: 50%;
	    top: 50%;
	    width: 350px;
		height: 350px;
	    margin: -190px 0 0 -175px;
	    border-radius: 5px;
	    background: rgba(255, 255, 255, 0.3);
	    overflow: hidden;
	}
</style>
